package framework.system;

import framework.fault.IFaultTolerantPeer;
import framework.grid.NodePeer;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface BackEnd extends Remote {
	public static String SERVICENAME = "BackEnd";
	
	public void joinGrid(NodePeer peer) throws RemoteException;
	public void leaveGrid(NodePeer peer) throws RemoteException;
	
	public String[] get(String key) throws RemoteException;
	public void put(String key, String value) throws RemoteException;
	public String[] remove(String key) throws RemoteException;
	
	public IFaultTolerantPeer[] publishIsolated(IFaultTolerantPeer newPeer) throws RemoteException;
	public IFaultTolerantPeer[] publishMissingLeft(IFaultTolerantPeer missingLeft) throws RemoteException;
	public IFaultTolerantPeer[] publishMissingRight(IFaultTolerantPeer missingRight) throws RemoteException;
}
